import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    myName:window.localStorage.getItem('myName2'),
    // keywords:window.localStorage.getItem("keywords")
    routes:[],
  },

  mutations: {
    login(state, name) {
      //这里不写的话就不能更新localstorage里面的值
      state.myName = name;
      window.localStorage.setItem('myName2', JSON.stringify(name));
    }
  /*  keywords(state,keywords){
      state.keywords = keywords;
      window.localStorage.setItem("keywords",JSON.stringify(keywords));
    }*/
  },
  actions: {}
});
